<template>
  <div class="app-container">
    <Find
      @clickNumber="clickNumber"
      @clickNumber1="clickNumber1"
      @Launchform="Launchform5"
      :OriginalFilter="{ static: true }"
      :formList="formList"
      @findClicked="findData"
    />

    <el-card style="margin-top: 10px" shadow="always" :body-style="{ padding: '5px' }">
      <h1>检核作业</h1>
      <Find
        @Launchform="Launchform"
        :OriginalFilter="{ static: true }"
        :searchImg="false"
        style="margin-bottom: 10px"
        :formList="formList1"
        @findClicked="findData1"
      />
      <div style="display: flex">
        <div style="width: 20%">
          <h1>材料入库单号查询</h1>
          <Table
            @selectList="selectList2"
            :isLoading="isLoading1"
            @currentRow="currentRow1"
            :selection="true"
            :tableHeader="tableHeader"
            :tableData="BottomWarehouseEntryNumberTableDate"
            :TableHeight="88"
          />
          <PageModule
            :PageData="{ buttonS: false, total: totalL, pageSizeShow: true }"
            :layout="'prev, pager'"
            @pageChange="pageChangeL"
            @pageSizeChange="pageSizeChangeL"
          />
        </div>
        <div style="width: 80%; margin-left: 10px">
          <div style="display: flex; justify-content: space-between">
            <h1>入库明细查询</h1>
            <div>
              <el-button :disabled="active"  style="margin-top: -10px; height: 25px" type="primary" size="default" @click="ChargingUnitPriceMethods">取单价</el-button>
              <el-button :disabled="active" style="margin-top: -10px; height: 25px" type="primary" size="default" @click="TakeUnitPrice1">填充单价</el-button>
            </div>
          </div>
          <Table
            @toBottom="toBottom"
            @toUp="toUp"
            @inputChange="checkboxChange1"
            summary
            :summaryData="summaryData1"
            @currentRow="currentRow"
            :isLoading="isLoading2"
            style="margin-bottom: 20px"
            :selection="true"
            :tableHeader="tableHeader1"
            :tableData="InventoryDetailsQueryTableDate"
            :TableHeight="40"
          />
          <h1>子材料明细</h1>
          <Table
            :isLoading="isLoading3"
            :selection="true"
            :tableHeader="tableHeader2"
            :tableData="QueryOfSubMaterialDetailsTable"
            :TableHeight="29"
          />
        </div>
      </div>

      <PageModule :PageData="{ pageSizeShow: true }" />
    </el-card>

    <el-dialog v-model="dialogVisible1" width="80%" class="dialog pb0">
      <Find
        @clickNumber1="clickNumber12"
        :OriginalFilter="{ static: true }"
        :searchImg="false"
        :formList="formList2"
        @Launchform="Launchform1"
        @findClicked="findData1"
      />
      <h1>入库明细查询</h1>
      <Table
        summary
        :summaryData="summaryData2"
        @clickNumber1="clickNumber12"
        :isLoading="isLoading5"
        :tableHeader="tableHeader5"
        :tableData="MaterialDetailsInquiryTableDate"
        :TableHeight="88"
      />
      <PageModule :PageData="{ buttonS: true, total }" :layout="'prev, pager'" @pageChange="pageChange" @pageSizeChange="pageSizeChange" />
    </el-dialog>
  </div>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import { ElMessage } from 'element-plus'
import JMessage from '@/utils/JMessage'
export default defineComponent({
  name: 'SurfaceMaterialHarvestCheck'
})
</script>
<script lang="ts" setup>
import { i18n, Jzhcn } from '@/i18n'
import type { formListType } from '@/components/Find/index.vue'
import { ref, onMounted } from 'vue'
import { VendorQuery } from '@/api/WarehouseDepartment/FactoryStorage/FitOutsourcingProcessing'
import {
  ChargingUnitPrice,
  MaterialDetailsInquiry,
  preserve,
  BottomWarehouseEntryNumber,
  InventoryDetailsQuery,
  remarkQuery,
  CheckWithCheckmark,
  QueryOfSubMaterialDetails,
  RemarksConfirmation
} from '@/api/GeneralFinanceDepartment/FactoryMaterialCost/SurfaceMaterialHarvestCheck'
//
const dialogVisible1 = ref(false)

const toUp = async (event: any, rowIndex: number, row: any, row1: any, prop: any) => {
  if (prop === 'prices') {
    const element = row.data[rowIndex + 1]

    if (element) {
      // 计算下一个行索引
      const nextRowIndex = rowIndex + 1

      // 确保下一个索引在范围内
      if (nextRowIndex < InventoryDetailsQueryTableDate.value.length) {
        // 通过 v-for 中的 :ref 属性获取下一个输入框
        const nextInput = document.getElementById(`input-${prop}${rowIndex + 1}`)
        if (nextInput) {
          ;(nextInput as HTMLInputElement).focus() // 将焦点设置到下一个输入框
          ;(nextInput as HTMLInputElement).select() // 选中输入框中的值
        }
      } else {
      }
    }
  }
}

const toBottom = async (event: any, rowIndex: any, row: any, row1: any, prop: any) => {
  console.log('321')
  if (prop === 'prices') {
    // 计算下一个行索引
    const nextRowIndex = rowIndex + 1
    console.log(nextRowIndex)
    // 确保下一个索引在范围内
    // 通过 v-for 中的 :ref 属性获取下一个输入框
    const nextInput = document.getElementById(`input-${prop}${rowIndex - 1}`)
    if (nextInput) {
      ;(nextInput as HTMLInputElement).focus() // 将焦点设置到下一个输入框
      ;(nextInput as HTMLInputElement).select() // 选中输入框中的值
    }
  }
}

// 取单价
const ChargingUnitPriceMethods = async () => {
  try {
    const result = await ChargingUnitPrice(InventoryDetailsQueryTableDate.value)
    if (result.code === 200) {
      InventoryDetailsQueryMethods()
      JMessage.success('成功' + result.data + '条')
    } else {
      JMessage.error(result.message)
    }
  } catch (error) {
    JMessage.error('取单价失败请重试')
  }
}

// 面材查询
const MaterialDetailsInquiryParms = ref<any>({
  check: '',
  financeRec: '',
  mtlName: '',
  mtlSpec: '',
  pageNum: 1,
  pageSize: 40,
  purLot: '',
  recEndDate: '',
  recNo: '',
  recStartDate: '',
  sendNo: '',
  vendorName: ''
})

const clickNumber12 = (row: any) => {
  switch (row) {
    case '1': {
      MaterialDetailsInquiryParms.value.check = 2
      break
    }
    case '2': {
      MaterialDetailsInquiryParms.value.check = 1
      break
    }
    case '0': {
      MaterialDetailsInquiryParms.value.check = ''
      break
    }
  }

  MaterialDetailsInquiryMethods()
}

const summaryData2 = ref<any[]>([
  {
    index: 13,
    num: 0
  },
  {
    index: 15,
    num: 0
  }
])

const Launchform1 = (row: any) => {
  MaterialDetailsInquiryParms.value.recNo = row[0].inputValue
  MaterialDetailsInquiryParms.value.recStartDate = row[1].dateValue[0]
  MaterialDetailsInquiryParms.value.recEndDate = row[1].dateValue[1]
  MaterialDetailsInquiryParms.value.vendorName = row[2].selectValue.split(' ')[0]
  MaterialDetailsInquiryParms.value.financeRec = row[3].inputValue
  MaterialDetailsInquiryParms.value.purLot = row[4].inputValue
  MaterialDetailsInquiryParms.value.sendNo = row[5].inputValue
  MaterialDetailsInquiryParms.value.mtlName = row[6].inputValue
  MaterialDetailsInquiryParms.value.mtlSpec = row[7].inputValue

  MaterialDetailsInquiryMethods()
}

const isLoading5 = ref(true)

const MaterialDetailsInquiryTableDate = ref([])

const MaterialDetailsInquiryMethods = async () => {
  try {
    isLoading5.value = true
    const result = await MaterialDetailsInquiry(MaterialDetailsInquiryParms.value)
    MaterialDetailsInquiryTableDate.value = result.list.map((item: any) => {
      if (item.cfmFlag === 'Y') {
        item.backgroundColor = '#80c080'
      }
      // item.prices = parseFloat(item.prices).toString();
      return item
    })
    summaryData2.value[0].num = result.acceptTotal
    summaryData2.value[1].num = result.amtTotal
    total.value = result.total3
    isLoading5.value = false
  } catch (error) {
    isLoading5.value = false
    JMessage.error('明细查询出错')
  }
}

const total = ref(0)

const pageChange = (val: any) => {
  MaterialDetailsInquiryParms.value.pageNum = val
  MaterialDetailsInquiryMethods()
}

const pageSizeChange = (val: any) => {
  MaterialDetailsInquiryParms.value.pageSize = val
  MaterialDetailsInquiryMethods()
}

const formList2 = ref<any>([
  {
    type: 'input',
    inputPlaceholder: '入库单号',
    inputValue: ''
  },
  {
    type: 'date',
    dateLabel: '入库日期',
    dateValue: ''
  },
  {
    type: 'select',
    selectValue: '',
    selectP: '厂商',
    selectLabel: '',
    selectOptions: []
  },
  {
    type: 'input',
    inputPlaceholder: '结算月份',
    inputValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '指令',
    inputValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '送货单号',
    inputValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '材料名称',
    inputValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '规格',
    inputValue: ''
  },
  {
    type: 'button',
    checkboxLabel: '置空',
    bgColor: '#1890FF'
  },
  {
    type: 'radio1',
    checkboxLabel: '未检核',
    checked: false,
    label: '2'
  },
  {
    type: 'radio1',
    checkboxLabel: '已检核',
    checked: false,
    label: '1'
  },
  {
    type: 'radio1',
    checkboxLabel: '全部',
    checked: true,
    label: '0'
  },
  {
    type: 'button',
    checkboxLabel: '导出明细'
  }
])

// 保存
const preserveMethods = async () => {
  try {
    const result = await preserve(InventoryDetailsQueryTableDate.value)
    if (result.code === 200) {
      JMessage.success(result.message)
      InventoryDetailsQueryMethods()
    } else {
      JMessage.error(result.message)
    }
  } catch (error) {
    JMessage.error('保存出错请重试')
  }
}

const summaryData1 = ref<any[]>([
  {
    index: 12,
    num: 0
  },
  {
    index: 16,
    num: 0
  }
])

// 取单价
const TakeUnitPrice = () => {
  summaryData1.value[0].num = 0
  summaryData1.value[1].num = 0
  InventoryDetailsQueryTableDate.value = InventoryDetailsQueryTableDate.value.map((item: any) => {
    if (item.amt !== null && item.acceptQty !== null) {
      item.price = parseFloat((item.amt / item.acceptQty).toFixed(4))
    } else {
      item.price = ''
    }
    summaryData1.value[0].num += Number(item.acceptQty)
    summaryData1.value[1].num += Number(item.amt)

    return item
  })
}

const TakeUnitPrice1 = () => {
  summaryData1.value[0].num = 0
  summaryData1.value[1].num = 0
  if (InventoryDetailsQueryTableDate.value[0].prices === null) {
    JMessage.warning('第一行单价不可为空')
  } else {
    InventoryDetailsQueryTableDate.value = InventoryDetailsQueryTableDate.value.map((item: any) => {
      item.prices = InventoryDetailsQueryTableDate.value[0].prices
      item.amts = item.prices * item.acceptQty
      item.prices = parseFloat(item.prices).toFixed(5)
      item.amts = parseFloat(item.amts).toFixed(2)
      summaryData1.value[0].num += Number(item.acceptQty)
      summaryData1.value[1].num += Number(item.amts)
      return item
    })
    summaryData1.value[0].num = parseFloat(summaryData1.value[0].num).toFixed(2)
    summaryData1.value[1].num = parseFloat(summaryData1.value[1].num).toFixed(2)
  }
}

const checkboxChange1 = async (list: any) => {
  if (list.prices !== null && list.acceptQty !== null) {
    list.amts = parseFloat((list.prices * list.acceptQty).toFixed(4))
  }
}

// 备注确认
const remarkList = ref('')

const Launchform = (row: any) => {
  remarkList.value = row[2].selectValue
}

const RemarksConfirmationParms = ref([])

const RemarksConfirmationMethods = async () => {
  try {
    const result = await RemarksConfirmation(remarkList.value, RemarksConfirmationParms.value)
    if (result.code === 200) {
      RemarksConfirmationParms.value = []
      JMessage.success(result.message)
      BottomWarehouseEntryNumberMethdos()
    } else {
      JMessage.error(result.message)
    }
  } catch (error) {
    JMessage.error('备注确认异常')
  }
}

// 子材料明细查询
const mtlNoList = ref('')

const QueryOfSubMaterialDetailsTable = ref([])

const isLoading3 = ref(true)

const currentRow = (row: any) => {
  mtlNoList.value = row.mtlNo
  QueryOfSubMaterialDetailsMethods()
}

const QueryOfSubMaterialDetailsMethods = async () => {
  try {
    isLoading3.value = true
    const result = await QueryOfSubMaterialDetails(mtlNoList.value)
    QueryOfSubMaterialDetailsTable.value = result.map((item: any) => {
      if (item.purFlag === 'Y') {
        item.purFlag = true
      }
      return item
    })
    isLoading3.value = false
  } catch (error) {
    isLoading3.value = false
    JMessage.error('子材料明细查询出错')
  }
}

// 打勾记录检核
const CheckWithCheckmarkParms = ref([])

const choolseList = ref()

const selectList2 = (row: any) => {
  CheckWithCheckmarkParms.value = row.map((item: any) => {
    return item
  })

  RemarksConfirmationParms.value = row.map((item: any) => {
    return item
  })
}

const CheckWithCheckmarkMethods = async () => {
  try {
    const result = await CheckWithCheckmark(choolseList.value, CheckWithCheckmarkParms.value)
    if (result.code === 200) {
      CheckWithCheckmarkParms.value = []
      JMessage.success(result.message)
      BottomWarehouseEntryNumberMethdos()
    } else {
      JMessage.error(result.message)
    }
  } catch (error) {
    JMessage.error('检核出错请重试')
  }
}

const findData1 = (row: any) => {
  if (row === '打勾记录检核') {
    choolseList.value = 1
    if (CheckWithCheckmarkParms.value.length === 0) {
      JMessage.warning('请勾选需要检核的数据')
    } else {
      CheckWithCheckmarkMethods()
    }
  }
  if (row === '打勾记录取消检核') {
    choolseList.value = 2
    if (CheckWithCheckmarkParms.value.length === 0) {
      JMessage.warning('请勾选需要取消检核的数据')
    } else {
      CheckWithCheckmarkMethods()
    }
  }

  if (row === '备注确认') {
    choolseList.value = 2
    if (RemarksConfirmationParms.value.length === 0) {
      JMessage.warning('请勾选需要修改备注的数据')
    } else if (remarkList.value == '') {
      JMessage.warning('请选择备注信息')
    } else {
      RemarksConfirmationMethods()
    }
  }
  if (row === '保存') {
    preserveMethods()
  }
}

// 备注信息查询
const remarkQueryMethods = async () => {
  try {
    const result = await remarkQuery()
    formList1.value[2].selectOptions = EvaluatesTheArrayReturnValue(result)
  } catch (error) {
    JMessage.error('备注信息查询出错')
  }
}

// 厂商查询
const VendorQueryMethods = async () => {
  let NewArray = []
  const result = await VendorQuery()
  NewArray = result.reduce((arr: any, item: any) => {
    if (item.vendorNo && item.vendorName) {
      // 只添加非空的 typeName 和 typeNo
      arr.push(item.vendorNo + ' ' + item.vendorName)
    }
    return arr
  }, [])
  formList.value[2].selectOptions = EvaluatesTheArrayReturnValue(NewArray)
  formList2.value[2].selectOptions = EvaluatesTheArrayReturnValue(NewArray)
}

const EvaluatesTheArrayReturnValue = (ArrayList: any) => {
  return ArrayList.map((item: any, index: any) => {
    return {
      optionKey: index,
      optionValue: item,
      optionLabel: item
    }
  })
}

// 入库明细查询
const recQtyList = ref('')

const currentRow1 = (row: any) => {
  recQtyList.value = row.recNo
  InventoryDetailsQueryMethods()
}

const InventoryDetailsQueryTableDate = ref<any>([])

const InventoryDetailsQueryMethods = async () => {
  summaryData1.value[0].num = 0
  summaryData1.value[1].num = 0
  try {
    isLoading2.value = true
    const result = await InventoryDetailsQuery(recQtyList.value)
    InventoryDetailsQueryTableDate.value = result.list.map((item: any) => {
      item.amts = Number(item.amts).toFixed(2)
      if (item.cfmFlag !== 'Y') {
        item.change = 'Y'
        item.disableConfirm = true
      }
      if (item.slipType === '多购') {
        item.backgroundColor = '#FFE0E0'
      }
      if (Number(item.usage) > Number(item.acceptQty)) {
        item.backgroundColor2 = '#FFE0E0'
      }
      summaryData1.value[0].num = result.actTotal
      summaryData1.value[1].num = result.amtTotal

      return item
    })
    if (result.list.length !== 0) {
      mtlNoList.value = result.list[0].mtlNo
      QueryOfSubMaterialDetailsMethods()
    }
    isLoading2.value = false
  } catch (error) {
    JMessage.error('入库明细查询出错')
    isLoading2.value = false
  }
}

// 单号查询
const BottomWarehouseEntryNumberParms = ref<any>({
  checkFlag: '1',
  lotNo: '',
  markFlag: '',
  mtlName: '',
  pageNum: 1,
  pageSize: 40,
  recEndDate: '',
  recNo: '',
  recStartDate: '',
  sendMonth: '',
  sendNo: '',
  vendorName: ''
})

const clickNumber = (row: any) => {
  
  switch (row) {
    case '1': {
      BottomWarehouseEntryNumberParms.value.checkFlag = 1
      active.value = false
      formList1.value[0].disabled = false
      break
    }
    case '2': {
      BottomWarehouseEntryNumberParms.value.checkFlag = 2
      active.value = true
      formList1.value[0].disabled = ''
      break
    }
    case '3': {
      BottomWarehouseEntryNumberParms.value.checkFlag = ''
      formList1.value[0].disabled = false
      active.value = false
      break
    }
  }

  BottomWarehouseEntryNumberMethdos()
}

const active = ref(false)

const clickNumber1 = (row: any) => {
  switch (row) {
    case '0': {
      BottomWarehouseEntryNumberParms.value.markFlag = ''
      break
    }
    case '1': {
      BottomWarehouseEntryNumberParms.value.markFlag = 1
      
      break
    }
    case '2': {
      BottomWarehouseEntryNumberParms.value.markFlag = 2
      
      break
    }
  }

  BottomWarehouseEntryNumberMethdos()
}

const Launchform5 = (row: any) => {
  BottomWarehouseEntryNumberParms.value.recNo = row[0].inputValue
  BottomWarehouseEntryNumberParms.value.recStartDate = row[1].dateValue[0]
  BottomWarehouseEntryNumberParms.value.recEndDate = row[1].dateValue[1]
  BottomWarehouseEntryNumberParms.value.vendorName = row[2].selectValue.split(' ')[1]
  BottomWarehouseEntryNumberParms.value.lotNo = row[3].inputValue
  BottomWarehouseEntryNumberParms.value.mtlName = row[4].inputValue
  BottomWarehouseEntryNumberParms.value.sendNo = row[5].inputValue
  BottomWarehouseEntryNumberParms.value.sendMonth = row[6].inputValue
  BottomWarehouseEntryNumberMethdos()
}

onMounted(() => {
  VendorQueryMethods()

  remarkQueryMethods()
})

const isLoading1 = ref(true)
const isLoading2 = ref(true)

const BottomWarehouseEntryNumberTableDate = ref<any>([])

const BottomWarehouseEntryNumberMethdos = async () => {
  try {
    isLoading1.value = true
    const result = await BottomWarehouseEntryNumber(BottomWarehouseEntryNumberParms.value)
    BottomWarehouseEntryNumberTableDate.value = result.list.map((item: any) => {
      if (item.cfmFlag === 'Y') {
        item.backgroundColor = '#80c080'
      }

      return item
    })
    totalL.value = result.total
    if (result.list.length !== 0) {
      recQtyList.value = result.list[0].recNo
      InventoryDetailsQueryMethods()
    }
    isLoading1.value = false
  } catch (error) {
    JMessage.error('大底入库单号查询出错')
    isLoading1.value = false
  }
}

const totalL = ref(0)

const pageChangeL = (val: any) => {
  BottomWarehouseEntryNumberParms.value.pageNum = val
  BottomWarehouseEntryNumberMethdos()
}

const pageSizeChangeL = (val: any) => {
  BottomWarehouseEntryNumberParms.value.pageSize = val
  BottomWarehouseEntryNumberMethdos()
}

const formList = ref<any>([
  {
    type: 'input',
    inputPlaceholder: '入库单号',
    inputValue: ''
  },
  {
    type: 'date',
    dateLabel: '入库日期',
    dateValue: ''
  },
  {
    type: 'select',
    selectValue: '',
    selectP: '厂商',
    selectLabel: '',
    selectOptions: []
  },
  {
    type: 'input',
    inputPlaceholder: '指令',
    inputValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '材料名称',
    inputValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '送货单号',
    inputValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '送货月份',
    inputValue: ''
  },
  {
    type: 'button',
    checkboxLabel: '置空',
    bgColor: '#1890FF'
  },
  {
    type: 'radio',
    checkboxLabel: '未检核',
    checked: false,
    label: '1'
  },
  {
    type: 'radio',
    checkboxLabel: '已检核',
    checked: false,
    label: '2'
  },
  {
    type: 'radio',
    checkboxLabel: '全部',
    checked: true,
    label: '3'
  },
  {
    type: 'radio1',
    checkboxLabel: '未标记',
    checked: false,
    label: '1'
  },
  {
    type: 'radio1',
    checkboxLabel: '已标记',
    checked: false,
    label: '2'
  },
  {
    type: 'radio1',
    checkboxLabel: '全部',
    checked: true,
    label: '0'
  },
  {
    type: 'button',
    checkboxLabel: '明细查询'
  }
])

const formList1 = ref<any>([
  {
    type: 'button',
    checkboxLabel: '打勾记录检核'
  },
  {
    type: 'button',
    checkboxLabel: '打勾记录取消检核'
  },
  {
    type: 'select',
    selectValue: '',
    selectP: '备注信息',
    selectLabel: '',
    selectOptions: []
  },
  {
    type: 'button',
    checkboxLabel: '备注确认'
  },
  {
    type: 'button',
    checkboxLabel: '保存'
  }
])

const findData = (count: any) => {
  if (count === '置空') {
    formList.value.forEach((item: any) => {
      item.inputValue = ''
      item.selectValue = ''
      item.dateValue = ''
    })
  }
  if (count === '明细查询') {
    dialogVisible1.value = true
    MaterialDetailsInquiryMethods()
  }
}

const tableHeader = ref([
  {
    label: '入库单号',
    prop: 'recNo',
    backgroundColor: true
  },
  {
    label: '入库日期',
    prop: 'recDate'
  },
  {
    label: '财务标记',
    prop: 'recFlag',
    width: '50'
  },
  {
    label: '财务备注',
    prop: 'cremark'
  }
])

const tableHeader1 = ref([
  {
    label: '送货日期',
    prop: 'sendDate',
    change: true
  },
  {
    label: '送货单号',
    prop: 'sendNo',
    change: true
  },
  {
    label: '订购单号',
    prop: 'purNo',
    change: true
  },
  {
    label: '厂商名称',
    prop: 'vendorName',
    change: true
  },
  {
    label: '指令',
    prop: 'purLot',
    change: true
  },
  {
    label: '型体',
    prop: 'purStyle',
    change: true
  },
  {
    label: '材料颜色',
    prop: 'mtlColor',
    change: true
  },
  {
    label: '材料名称',
    prop: 'mtlName',
    change: true
  },
  {
    label: '规格',
    prop: 'mtlSpec',
    change: true
  },
  {
    label: '单位',
    prop: 'mtlUnit',
    change: true
  },
  {
    label: '用量',
    prop: 'usage',
    change: true,
    backgroundColor2: true
  },
  {
    label: '暂收数量',
    prop: 'acceptQty',
    backgroundColor: true,
    change: true
  },
  {
    label: '退货数量',
    prop: 'returnQty'
  },
  {
    label: '类型',
    prop: 'slipType',
    backgroundColor: true,
    change: true
  },
  {
    label: '单价',
    prop: 'prices'
  },
  {
    label: '金额',
    prop: 'amts'
  },
  {
    label: '财务备注',
    prop: 'financeRecMemo'
  },
  {
    label: '仓库备注',
    prop: 'remark'
  },
  {
    label: '仓管员',
    prop: 'sysUser',
    change: true
  }
])

const tableHeader2 = ref([
  {
    label: '材料名称',
    prop: 'mtlName'
  },
  {
    label: '材料颜色',
    prop: 'mtlColor'
  },
  {
    label: '规格',
    prop: 'mtlSpec'
  },
  {
    label: '单位',
    prop: 'mtlUnit'
  },
  {
    label: '加工方式',
    prop: 'prdType'
  },
  {
    label: '比例',
    prop: 'percent'
  },
  {
    label: '是否请购',
    type: 'checkbox',
    prop: 'purFlag'
  }
])

const tableHeader5 = ref([
  {
    label: '入库单号',
    prop: 'recNo',
    backgroundColor: true
  },
  {
    label: '结算月份',
    prop: 'financeRecYymm'
  },
  {
    label: '送货日期',
    prop: 'sendDate'
  },
  {
    label: '送货单号',
    prop: 'sendNo'
  },
  {
    label: '订购单号',
    prop: 'purNo'
  },
  {
    label: '厂商名称',
    prop: 'mtlName'
  },
  {
    label: '指令',
    prop: 'purLot'
  },
  {
    label: '型体',
    prop: 'purStyle'
  },
  {
    label: '材料颜色',
    prop: 'mtlColor'
  },
  {
    label: '材料名称',
    prop: 'mtlName'
  },
  {
    label: '规格',
    prop: 'mtlSpec'
  },
  {
    label: '单位',
    prop: 'mtlUnit'
  },
  {
    label: '用量',
    prop: 'usage'
  },
  {
    label: '暂收数量',
    prop: 'acceptQty'
  },
  {
    label: '单价',
    prop: 'price'
  },
  {
    label: '金额',
    prop: 'amt'
  },
  {
    label: '财务备注',
    prop: 'financeRecMemo'
  },
  {
    label: '仓管备注',
    prop: 'remark'
  },
  {
    label: '仓管员',
    prop: 'sysUser'
  }
])
</script>

<style lang="less" scoped>
h1 {
  font-size: 14px;
  margin-bottom: 5px;
}
</style>
